<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>fastJson</title>
</head>

<body>
  <pre>
      {
        "category": "单据",
        "companyIdFieldName": {
          "allowCustomTransBill": false,
          "allowEmpty": false,
          "allowEmptyCondition": false,
          "allowNull": false,
          "canDuplicate": false,
          "canModifyInUsed": false,
          "checkInUsed": false,
          "condition": false,
          "controlType": {
            "typeName": "前端控件显示类型1"
          },
          "dataType": {
            "dataType": "数据类型1"
          },
          "dbTable": {
            "dataTable": {
              "allowCustomTransBill": false,
              "allowEmptyRow": false,
              "canDuplicate": false,
              "canModifyInUsed": false,
              "canViewTable": false,
              "dataSource": {
                "$ref": "$"
              },
              "dbTables": [{
                  "$ref": "$.companyIdFieldName.dbTable"
                },
                {
                  "dataTable": {
                    "$ref": "$.companyIdFieldName.dbTable.dataTable"
                  },
                  "dataTableIndex": 0,
                  "fields": [{
                      "allowCustomTransBill": false,
                      "allowEmpty": false,
                      "allowEmptyCondition": false,
                      "allowNull": false,
                      "canDuplicate": false,
                      "canModifyInUsed": false,
                      "checkInUsed": false,
                      "condition": false,
                      "controlType": {
                        "typeName": "前端控件显示类型1"
                      },
                      "dataType": {
                        "dataType": "数据类型1"
                      },
                      "dbTable": {
                        "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                      },
                      "fieldName": "商品名称",
                      "formatSourceField": {
                        "format": "格式化类型1"
                      },
                      "mergeOut": false,
                      "parameter": false,
                      "readOnly": false,
                      "readOnlyCondition": false,
                      "restrictAdvPerm": false,
                      "scale": 0,
                      "size": 20,
                      "useCulture": false
                    },
                    {
                      "allowCustomTransBill": false,
                      "allowEmpty": false,
                      "allowEmptyCondition": false,
                      "allowNull": false,
                      "canDuplicate": false,
                      "canModifyInUsed": false,
                      "checkInUsed": false,
                      "condition": false,
                      "controlType": {
                        "typeName": "前端控件显示类型1"
                      },
                      "dataType": {
                        "dataType": "数据类型1"
                      },
                      "dbTable": {
                        "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                      },
                      "fieldName": "商品销售数量",
                      "formatSourceField": {
                        "format": "格式化类型1"
                      },
                      "mergeOut": false,
                      "parameter": false,
                      "readOnly": false,
                      "readOnlyCondition": false,
                      "restrictAdvPerm": false,
                      "scale": 0,
                      "size": 20,
                      "useCulture": false
                    },
                    {
                      "allowCustomTransBill": false,
                      "allowEmpty": false,
                      "allowEmptyCondition": false,
                      "allowNull": false,
                      "canDuplicate": false,
                      "canModifyInUsed": false,
                      "checkInUsed": false,
                      "condition": false,
                      "controlType": {
                        "typeName": "前端控件显示类型1"
                      },
                      "dataType": {
                        "dataType": "数据类型1"
                      },
                      "dbTable": {
                        "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                      },
                      "fieldName": "单价",
                      "formatSourceField": {
                        "format": "格式化类型1"
                      },
                      "mergeOut": false,
                      "parameter": false,
                      "readOnly": false,
                      "readOnlyCondition": false,
                      "restrictAdvPerm": false,
                      "scale": 0,
                      "size": 20,
                      "useCulture": false
                    },
                    {
                      "allowCustomTransBill": false,
                      "allowEmpty": false,
                      "allowEmptyCondition": false,
                      "allowNull": false,
                      "canDuplicate": false,
                      "canModifyInUsed": false,
                      "checkInUsed": false,
                      "condition": false,
                      "controlType": {
                        "typeName": "前端控件显示类型1"
                      },
                      "dataType": {
                        "dataType": "数据类型1"
                      },
                      "dbTable": {
                        "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                      },
                      "fieldName": "总金额",
                      "formatSourceField": {
                        "format": "格式化类型1"
                      },
                      "mergeOut": false,
                      "parameter": false,
                      "readOnly": false,
                      "readOnlyCondition": false,
                      "restrictAdvPerm": false,
                      "scale": 0,
                      "size": 20,
                      "useCulture": false
                    },
                    {
                      "allowCustomTransBill": false,
                      "allowEmpty": false,
                      "allowEmptyCondition": false,
                      "allowNull": false,
                      "canDuplicate": false,
                      "canModifyInUsed": false,
                      "checkInUsed": false,
                      "condition": false,
                      "controlType": {
                        "typeName": "前端控件显示类型1"
                      },
                      "dataType": {
                        "dataType": "数据类型1"
                      },
                      "dbTable": {
                        "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                      },
                      "fieldName": "总成本",
                      "formatSourceField": {
                        "format": "格式化类型1"
                      },
                      "mergeOut": false,
                      "parameter": false,
                      "readOnly": false,
                      "readOnlyCondition": false,
                      "restrictAdvPerm": false,
                      "scale": 0,
                      "size": 20,
                      "useCulture": false
                    }
                  ],
                  "index": 2,
                  "indexList": [{
                    "indexFields": [{
                      "indexField": {
                        "$ref": "$.companyIdFieldName"
                      },
                      "orderType": "desc"
                    }],
                    "name": "表1的索引",
                    "uniqueIndex": false
                  }],
                  "name": "销售明细表",
                  "primatyKeyFields": [{
                    "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[4]"
                  }]
                }
              ],
              "displayName": "销售单据",
              "index": 1,
              "requiredFieldsBeforeNewRow": {
                "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[0]"
              },
              "stateFieldName": {
                "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[1]"
              }
            },
            "dataTableIndex": 0,
            "fields": [{
                "$ref": "$.companyIdFieldName"
              },
              {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型2"
                },
                "dataType": {
                  "dataType": "数据类型2"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable"
                },
                "fieldName": "日期字段",
                "formatSourceField": {
                  "format": "格式化类型2"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              },
              {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable"
                },
                "fieldName": "销售总金额",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              },
              {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable"
                },
                "fieldName": "销售总数",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              },
              {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable"
                },
                "fieldName": "客户名称",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              }
            ],
            "index": 1,
            "indexList": [{
              "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].indexList[0]"
            }],
            "name": "销售订单表",
            "primatyKeyFields": [{
              "$ref": "$.companyIdFieldName.dbTable.fields[4]"
            }]
          },
          "fieldName": "公司名称字段",
          "formatSourceField": {
            "format": "格式化类型1"
          },
          "mergeOut": false,
          "parameter": false,
          "readOnly": false,
          "readOnlyCondition": false,
          "relativeSources": [{
            "checkSource": false,
            "checkValidDate": false,
            "dataSourceName": {
              "$ref": "$"
            },
            "groupIndex": 0,
            "mainSelViewDS": false,
            "relativeFields": [{
              "condition": false,
              "displayName": "关联字段a",
              "fieldName": {
                "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[0]"
              }
            }],
            "relativeIndex": 1,
            "updateSource": false
          }],
          "requiredFieldsBeforeUpdate": [{
            "$ref": "$.companyIdFieldName.dbTable.fields[3]"
          }],
          "restrictAdvPerm": false,
          "scale": 0,
          "size": 20,
          "useCulture": false
        },
        "dataFieldName": {
          "$ref": "$.companyIdFieldName.dbTable.fields[1]"
        },
        "dataTables": [{
          "$ref": "$.companyIdFieldName.dbTable.dataTable"
        }],
        "jumpMode": "CodeRule",
        "name": "销售管理",
        "validityFromDataFieldName": "2018-07-31 14:11:55",
        "validitytoDataFieldName": "2018-07-31 14:11:55"
      }
  </pre>
  <script src="./JsonCore.js"></script>
  <script>
    let myJson = {
      "category": "单据",
      "companyIdFieldName": {
        "allowCustomTransBill": false,
        "allowEmpty": false,
        "allowEmptyCondition": false,
        "allowNull": false,
        "canDuplicate": false,
        "canModifyInUsed": false,
        "checkInUsed": false,
        "condition": false,
        "controlType": {
          "typeName": "前端控件显示类型1"
        },
        "dataType": {
          "dataType": "数据类型1"
        },
        "dbTable": {
          "dataTable": {
            "allowCustomTransBill": false,
            "allowEmptyRow": false,
            "canDuplicate": false,
            "canModifyInUsed": false,
            "canViewTable": false,
            "dataSource": {
              "$ref": "$"
            },
            "dbTables": [{
              "$ref": "$.companyIdFieldName.dbTable"
            }, {
              "dataTable": {
                "$ref": "$.companyIdFieldName.dbTable.dataTable"
              },
              "dataTableIndex": 0,
              "fields": [{
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                },
                "fieldName": "商品名称",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              }, {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                },
                "fieldName": "商品销售数量",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              }, {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                },
                "fieldName": "单价",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              }, {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                },
                "fieldName": "总金额",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              }, {
                "allowCustomTransBill": false,
                "allowEmpty": false,
                "allowEmptyCondition": false,
                "allowNull": false,
                "canDuplicate": false,
                "canModifyInUsed": false,
                "checkInUsed": false,
                "condition": false,
                "controlType": {
                  "typeName": "前端控件显示类型1"
                },
                "dataType": {
                  "dataType": "数据类型1"
                },
                "dbTable": {
                  "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1]"
                },
                "fieldName": "总成本",
                "formatSourceField": {
                  "format": "格式化类型1"
                },
                "mergeOut": false,
                "parameter": false,
                "readOnly": false,
                "readOnlyCondition": false,
                "restrictAdvPerm": false,
                "scale": 0,
                "size": 20,
                "useCulture": false
              }],
              "index": 2,
              "indexList": [{
                "indexFields": [{
                  "indexField": {
                    "$ref": "$.companyIdFieldName"
                  },
                  "orderType": "desc"
                }],
                "name": "表1的索引",
                "uniqueIndex": false
              }],
              "name": "销售明细表",
              "primatyKeyFields": [{
                "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[4]"
              }]
            }],
            "displayName": "销售单据",
            "index": 1,
            "requiredFieldsBeforeNewRow": {
              "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[0]"
            },
            "stateFieldName": {
              "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[1]"
            }
          },
          "dataTableIndex": 0,
          "fields": [{
            "$ref": "$.companyIdFieldName"
          }, {
            "allowCustomTransBill": false,
            "allowEmpty": false,
            "allowEmptyCondition": false,
            "allowNull": false,
            "canDuplicate": false,
            "canModifyInUsed": false,
            "checkInUsed": false,
            "condition": false,
            "controlType": {
              "typeName": "前端控件显示类型2"
            },
            "dataType": {
              "dataType": "数据类型2"
            },
            "dbTable": {
              "$ref": "$.companyIdFieldName.dbTable"
            },
            "fieldName": "日期字段",
            "formatSourceField": {
              "format": "格式化类型2"
            },
            "mergeOut": false,
            "parameter": false,
            "readOnly": false,
            "readOnlyCondition": false,
            "restrictAdvPerm": false,
            "scale": 0,
            "size": 20,
            "useCulture": false
          }, {
            "allowCustomTransBill": false,
            "allowEmpty": false,
            "allowEmptyCondition": false,
            "allowNull": false,
            "canDuplicate": false,
            "canModifyInUsed": false,
            "checkInUsed": false,
            "condition": false,
            "controlType": {
              "typeName": "前端控件显示类型1"
            },
            "dataType": {
              "dataType": "数据类型1"
            },
            "dbTable": {
              "$ref": "$.companyIdFieldName.dbTable"
            },
            "fieldName": "销售总金额",
            "formatSourceField": {
              "format": "格式化类型1"
            },
            "mergeOut": false,
            "parameter": false,
            "readOnly": false,
            "readOnlyCondition": false,
            "restrictAdvPerm": false,
            "scale": 0,
            "size": 20,
            "useCulture": false
          }, {
            "allowCustomTransBill": false,
            "allowEmpty": false,
            "allowEmptyCondition": false,
            "allowNull": false,
            "canDuplicate": false,
            "canModifyInUsed": false,
            "checkInUsed": false,
            "condition": false,
            "controlType": {
              "typeName": "前端控件显示类型1"
            },
            "dataType": {
              "dataType": "数据类型1"
            },
            "dbTable": {
              "$ref": "$.companyIdFieldName.dbTable"
            },
            "fieldName": "销售总数",
            "formatSourceField": {
              "format": "格式化类型1"
            },
            "mergeOut": false,
            "parameter": false,
            "readOnly": false,
            "readOnlyCondition": false,
            "restrictAdvPerm": false,
            "scale": 0,
            "size": 20,
            "useCulture": false
          }, {
            "allowCustomTransBill": false,
            "allowEmpty": false,
            "allowEmptyCondition": false,
            "allowNull": false,
            "canDuplicate": false,
            "canModifyInUsed": false,
            "checkInUsed": false,
            "condition": false,
            "controlType": {
              "typeName": "前端控件显示类型1"
            },
            "dataType": {
              "dataType": "数据类型1"
            },
            "dbTable": {
              "$ref": "$.companyIdFieldName.dbTable"
            },
            "fieldName": "客户名称",
            "formatSourceField": {
              "format": "格式化类型1"
            },
            "mergeOut": false,
            "parameter": false,
            "readOnly": false,
            "readOnlyCondition": false,
            "restrictAdvPerm": false,
            "scale": 0,
            "size": 20,
            "useCulture": false
          }],
          "index": 1,
          "indexList": [{
            "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].indexList[0]"
          }],
          "name": "销售订单表",
          "primatyKeyFields": [{
            "$ref": "$.companyIdFieldName.dbTable.fields[4]"
          }]
        },
        "fieldName": "公司名称字段",
        "formatSourceField": {
          "format": "格式化类型1"
        },
        "mergeOut": false,
        "parameter": false,
        "readOnly": false,
        "readOnlyCondition": false,
        "relativeSources": [{
          "checkSource": false,
          "checkValidDate": false,
          "dataSourceName": {
            "$ref": "$"
          },
          "groupIndex": 0,
          "mainSelViewDS": false,
          "relativeFields": [{
            "condition": false,
            "displayName": "关联字段a",
            "fieldName": {
              "$ref": "$.companyIdFieldName.dbTable.dataTable.dbTables[1].fields[0]"
            }
          }],
          "relativeIndex": 1,
          "updateSource": false
        }],
        "requiredFieldsBeforeUpdate": [{
          "$ref": "$.companyIdFieldName.dbTable.fields[3]"
        }],
        "restrictAdvPerm": false,
        "scale": 0,
        "size": 20,
        "useCulture": false
      },
      "dataFieldName": {
        "$ref": "$.companyIdFieldName.dbTable.fields[1]"
      },
      "dataTables": [{
        "$ref": "$.companyIdFieldName.dbTable.dataTable"
      }],
      "jumpMode": "CodeRule",
      "name": "销售管理",
      "validityFromDataFieldName": "2018-07-31 14:11:55",
      "validitytoDataFieldName": "2018-07-31 14:11:55"
    };
    let myJsonRetrocycle = JSON.retrocycle(myJson)
    console.log('前端可用数据类型', myJsonRetrocycle)
    let myJsonDecycle = JSON.decycle(myJsonRetrocycle)
    console.log('后端可用数据类型', myJsonDecycle)
  </script>
</body>

</html>